import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const meta = {
  requireAuth: true
}
export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/Login'
    },
    {
      path: '/Login',
      component: resolve => require(['../components/Common/Login.vue'], resolve)
    },
    {
      path: '/Home',
      meta,
      component: resolve => require(['../components/Common/Home.vue'], resolve),
      redirect: 'Home/MenuManage',
      children: [
        {
          path: 'MenuManage',
          meta,
          component: resolve => require(['../components/MenuManage/MenuManage.vue'], resolve)
        },
        {
          path: 'OrderManage',
          meta,
          component: resolve => require(['../components/OrderManage/OrderManage.vue'], resolve)
        },
        // {
        //   path: 'OrderDetail/:id',
        //   name: 'OrderDetail',
        //   meta,
        //   component: resolve => require(['../components/OrderDetail/OrderDetail.vue'], resolve)
        // },
        {
          path: 'ReportManage',
          meta,
          component: resolve => require(['../components/ReportManage/ReportManage.vue'], resolve)
        },
        {
          path: 'AccountManage',
          meta,
          component: resolve => require(['../components/AccountManage/AccountManage.vue'], resolve)
        },
        {
          path: 'OtherSetting',
          meta,
          component: resolve => require(['../components/OtherSetting/OtherSetting.vue'], resolve)
        }
      ]
    }
  ]
})
